package com.mdd.admin.service.refund;

import com.alipay.api.AlipayApiException;
import com.github.binarywang.wxpay.bean.notify.WxPayRefundNotifyResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.mdd.admin.validate.refund.OrderRefundPageParam;
import com.mdd.admin.vo.refund.OrderRefundDetailVo;
import com.mdd.admin.vo.refund.OrderRefundListVo;
import com.mdd.admin.vo.refund.StatisticsOrderRefundCountVo;
import com.mdd.admin.vo.refund.StatisticsOrderRefundVo;
import com.mdd.common.core.PageResult;
import com.mdd.common.entity.order.Order;
import com.mdd.common.entity.refund.OrderRefund;

import java.util.List;

/**
 * 订单退款服务接口类
 */
public interface IOrderRefundService {

    /**
     * 订单退款列表
     *
     * @param params 搜索参数
     * @return PageResult<OrderRefundVo>
     * @author slien
     */
    PageResult<OrderRefundListVo> list(OrderRefundPageParam params);

    StatisticsOrderRefundVo statisticsAmount();

    StatisticsOrderRefundCountVo statisticsCount(OrderRefundPageParam params);


    /**
     * 订单退款详情
     *
     * @param id 主键ID
     * @return OrderRefund
     * @author slien
     */
    OrderRefundDetailVo detail(Long id);

    /**
     * 订单退款删除
     *
     * @param id 主键ID
     * @author slien
     */
    void del(Integer id);

    void repeatRefund(Long refundId) throws WxPayException;

    boolean updateOrderStatusToPaid(WxPayRefundNotifyResult.ReqInfo reqInfo);

    void createAndRefund(Long orderId, Integer operateType) throws WxPayException, AlipayApiException;

    List<OrderRefund> getNoRefundOrderByDuration(int i);

    void checkRefundStatus(String refundNo) throws Exception;

    // 余额退款
    void balanceRefund(OrderRefund orderRefund);

    void checkBalanceRefund(OrderRefund refundNo);

    void rebates(Long refundId,Integer reviewStatus);
}
